<template>
  <div class="screen-full">
    <svg-icon :icon-class="isFull ? 'eye-open' : 'eye'" @click="toggleFullScreen" />
  </div>
</template>
<script>
import screenfull from 'screenfull'
export default {
  name: '',
  data() {
    return {
      isFull: false
    }
  },
  created() {
    screenfull.on('change', () => {
      console.log(111, screenfull.isFullscreen)
      this.isFull = screenfull.isFullscreen
    })
  },
  methods: {
    toggleFullScreen() {
      screenfull.toggle()
      this.isFull = !this.isFull
    }
  }
}
</script>

<style lang="scss" scoped>
.screen-full {
  display: inline-block;
  color: #ed6e6e;
  margin-right: 15px;
}
</style>
